package com.kws.merchant.domain;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

/**
 * @author : zhangbenting
 * @date : 2024/12/25 16:48
 * @Version: 1.0
 */
@Data
@TableName("tb_loan_application")
public class LoanApplicationEntity implements Serializable {

    @TableId(value = "id", type = IdType.ASSIGN_ID)
    @ApiModelProperty("主键ID")
    private Long id;

    @ApiModelProperty("用户ID")
    private Long userId;

    @ApiModelProperty("服务ID")
    @NotNull(message = "服务ID不能为空")
    private Long serveId;

    @ApiModelProperty("贷款期限")
    @NotBlank(message = "服务ID不能为空")
    private String loanTerm;

    @ApiModelProperty("贷款额度")
    @NotNull(message = "贷款额度不能为空")
    private BigDecimal loanQuota;

    @ApiModelProperty("用户类型(0企业 1个人)")
    @NotNull(message = "用户类型不能为空")
    private Integer userType;

    @ApiModelProperty("贷款企业")
    private String loanEnterprise;

    @ApiModelProperty("社会编号")
    private String societyNumber;

    @ApiModelProperty("申请人姓名")
    @NotBlank(message = "申请人姓名不能为空")
    private String applicantName;

    @ApiModelProperty("申请人电话")
    @NotBlank(message = "申请人电话不能为空")
    @Pattern(regexp = "^1(3|4|5|7|8|9)\\d{9}$",message = "手机号码格式错误")
    private String applicantPhone;

    @ApiModelProperty("营业执照")
    private String businessLicense;

    @ApiModelProperty("身份证号码")
    private String certificateNumber;

    @ApiModelProperty("身份证正面图片")
    private String certificateFront;

    @ApiModelProperty("身份证反面图片")
    private String certificateBack;

    @ApiModelProperty("创建时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @TableField(fill = FieldFill.INSERT)
    private Date createTime;

    @ApiModelProperty("更新时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private Date updateTime;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

}
